/*
 *Function: internalize():void
 *Uses global varaibles: str[], len, err, infrom[]
 *By: Sukhbir, Shang, Anuardha 
 *Tested by: Sukhbir Singh on 2/11/10
 *Report bugs to googel code under issue tab 
 */

void internalize(){
cout<<"Internal form:\n\n";
int i, j;
	static char inter[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
							0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
							0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 6, 4, 0, 5, 0, 7,
							0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
							0, 8, 9, 10,11,12,13,14,15,16,17,18,19,20,21,22,
							23,24,25,26,27,28,29,30,31,32, 33,0 ,0, 0, 0, 0,
							0, 34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
							49,50,51,52,53,54,55,56,57,58,59, 0 ,0, 0, 0, 0};
	char ch,code,k,*p,*q;
	
	k=0;
	q=&inform[0];
	p=&str[0];
	
	while(*p!='\0'){
		code=inter[(int)*p];
			*q=code;
			q++;
			
			if(k+code==0){
				k=p-str+1;
				ch=*p;
			}
			p++;

	}
		*q='\0';
		
		i=j=0;
		p=&inform[0];
		
		while(j<len){
			cout<<setw(3)<<(int)*p;
			if(++i==16){
				cout<<'\n';
				i=0;
			}
			p++;
			j++;
		}
		
		if(i!=0){
			cout<<'\n';
		}
		if(err=(0<k)!=0){
			cout<<"\n**" <<(int)k<<"-th nonblank char<"<<ch<<">is illegal **\n";
		}
}